<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="cn.hit.edu.switter.*" %>
<%@ page import="cn.hit.edu.switter.DatabaseHelper" %>
<%@ page import="java.util.ArrayList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
	int id = (Integer)session.getAttribute("UserId");
%> 
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<link rel="stylesheet" href="base.css" type="text/css" media="screen"
	charset="utf-8" />
<title>随便看看大家在做什么..._Switter</title>

</head>
<body>
	<div id="container" class="newlook">
		<div id="header">
			<h1>
				<a href="home.jsp"><img
					src="RESOURCE/switter.png" alt="Switter" /><span>首页</span>
				</a>
			</h1>
			<div id="navigation" class="ui-roundedbox">
				<div class="ui-roundedbox-corner ui-roundedbox-tl">
					<div class="ui-roundedbox-corner ui-roundedbox-tr">
						<div class="ui-roundedbox-corner ui-roundedbox-bl">
							<div class="ui-roundedbox-corner ui-roundedbox-br">
								<div class="ui-roundedbox-content">
									<ul>
	<li><a href="index.jsp">首页</a></li>
	<li><a href="home.jsp?Id=<%=id%>">我的空间</a></li>
	<li><a href="browse.jsp">随便看看</a></li>

	<li><a href="/Switter_beta/settings.jsp">设置</a></li>
	<li><a href="/Switter_beta/logout">退出</a></li>
	</li>
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<table id="columns">
			<tr>
				<td id="main">
					<div id="content">
						<div id="stream" class="message">
							<h3>随便看看其他人在做什么...</h3>
							
							<!-- 核心代码 -->
							
							<ol class="wa">
							<%
								DatabaseHelper db = new DatabaseHelper();
								ArrayList<Message> msgs = db.fetchAllUserMessages();
								
								if (msgs != null) {
								for (int i = 0; i < msgs.size(); i++) {
									String msg = msgs.get(i).getMsg();
									String time = msgs.get(i).getPostTime().toLocaleString();
									int uId = msgs.get(i).getUserId();
									Account acc = db.fetchAccount(uId);
									String nickname = acc.getNickname();
									String picName = acc.getPicName();
							%>
								<li><a href="/Switter_beta/home.jsp?Id=<%=uId %>" title="<%=nickname %> %>" class="avatar"><img
										src="/Switter_beta/Avatars/<%= picName%>"
										alt="<%=nickname %>" />
								</a><a href="/Switter_beta/home.jsp?Id=<%=uId %>" class="author"><%= nickname%></a> 
								<span class="content"><%=msg %></span>
								<span class="stamp"><a href=""
									class="time" title="<%= id%>" ffid="kKXRFiwfRGU"
									stime="<%=time%>">1 秒前</a>
								</span>
								<span class="op">
									<a
										href="<%=id %>"
										ffname="<%=id %>" ffid="kKXRFiwfRGU" class="reply" title="回复<%=id %>">回复<%= id%></a><a
										href="/favorite.add/kKXRFiwfRGU" class="post_act share"
										title="添加到我的收藏" token="168912a8">收藏</a><a
										href=""
										ffid="kKXRFiwfRGU" text="<%= id%>"
										class="repost" title="转发">转发</a>
								</span>
							<%
							}}
							%>
							</ol>
						</div>
					</div></td>
				<td id="sidebar">
					<div class="sect first-sect">
						<h2>公告</h2>
						<ul class="tlist">
							<li><a href="http://help.switter.com/joinus.html"
								target="_blank">加入Switter团队</a><sup
								style="font-size: 12px; color: red;">New!</sup>
							</li>
							<li>短信请发到：1069 0029 3152</li>
							<li>彩信请发到：m@switter.com</li>
							<li>Switter手机版：m.switter.com</li>
							<li>SwitteriPhone：i.switter.com</li>
							<li><a href="http://switter.com/switter">更多历史公告...</a>
							</li>
						</ul>
					</div>
					<div class="sect">
						<h2>推荐</h2>
						<ul class="alist">
							<li><a href="/dongdongqiang" title="东东枪"><img
									src="http://avatar.switter.com/s0/00/5b/jr.jpg?1293448319"
									alt="东东枪" /><span>东东枪</span>
							</a>
							</li>
						</ul>
					</div></td>
			</tr>
		</table>
		
	</div>
	
</body>
</html>
